USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  StoredProcedure [dbo].[CreateDataBaseBackup]    Script Date: 06/05/2014 00:17:00 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CreateDataBaseBackup]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[CreateDataBaseBackup]
GO

USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  StoredProcedure [dbo].[CreateDataBaseBackup]    Script Date: 06/05/2014 00:17:00 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[CreateDataBaseBackup]
(     @PathName VARCHAR(255),

      @DatabaseName VARCHAR(255)
 )

AS

BEGIN

      SET NOCOUNT ON;

      DECLARE @filePathLocation VARCHAR(500)

      SET @filePathLocation = @PathName + @DatabaseName + CONVERT(NVARCHAR(500),GETDATE(),112) + '.BAK'

      BACKUP DATABASE @DatabaseName

      TO DISK = @filePathLocation

      WITH NOINIT,

      NAME = 'FULL BACKUP'

END


GO


